/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.playground.core.entity.boardgame.chesslikegame.checkers;

import com.playground.core.entity.boardgame.Square;
import com.playground.core.entity.boardgame.chesslikegame.ChessLikeBoard;
import com.playground.core.entity.boardgame.chesslikegame.ChessLikeSquare;
import java.util.ArrayList;

/**
 * Represents a board of a checkers game.
 * 
 * @author Tiago Peres
 */
public class CheckersBoard extends ChessLikeBoard {

    public CheckersBoard(){
        super();
        createSquares();
    }
    
    private void createSquares() {
        ArrayList<Square> squares = new ArrayList<Square>();
        boolean realSquare = false;
        for (int i = 0; i < 8; i++){
            realSquare = !realSquare;
            for (int j = 0; j < 8; j++){
                if (realSquare){
                    squares.add(new ChessLikeSquare(i * 8 + j));
                } else{
                    squares.add(null);
                }
                realSquare = !realSquare;
            }
        }
        setSquares(squares);
    }
    
}
